home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-19 / mega211a.zip / HERC.PAS < prev    next >
Pascal/Delphi Source File  |  1990-07-05  |  1KB  |  67 lines

  1.  
  2. {  HERC.PAS - (c) 1990 TommySoftware
  3.  
  4.    A sample program used for displaying prictures exported from
  5.    MegaPaint PC with the command "Export bitimage-Hercules"
  6.  
  7.    Notes:
  8.    - You must have a Borland's Turbo-Pascal to compile this program.
  9.    - There should be a file called HERC.BGI supplied by Borland
  10.      in the current directory when you run this program.
  11.    - Program is called with one parameter which is the full name
  12.      of the 32k file exported from MegaPaint PC with the command
  13.      "Export bitimage-Hercules"
  14.  
  15. }
  16.  
  17.  
  18. program HERC;
  19.  
  20. uses CRT, GRAPH;
  21.  
  22. type screenblock = array[0..32767]of byte;
  23.  
  24. var grdriver, grmode, err : integer;
  25.     f : file of screenblock;
  26.     screen : screenblock absolute $B000:$0000;
  27.     ch : char;
  28.  
  29.  
  30. begin
  31.  
  32.   if paramcount < 1 then begin
  33.     writeln('Filename required.');
  34.     halt(1);
  35.   end;
  36.  
  37.   grdriver := DETECT;
  38.   initgraph(grdriver,grmode,'');
  39.   err := graphresult;
  40.   if err <> grOk then begin
  41.     writeln('ERROR: ', grapherrormsg(err));
  42.     halt(2);
  43.   end;
  44.   if grdriver <> HERCMONO then begin
  45.     closegraph;
  46.     writeln('You must have a hercules graphic adapter to run this program.');
  47.     halt(3);
  48.   end;
  49.  
  50.   assign(f, paramstr(1));
  51.   {$I-}
  52.   reset(f);
  53.   {$I+}
  54.   if ioresult <> 0 then begin
  55.     closegraph;
  56.     writeln('File "',paramstr(1),'" not found.');
  57.     halt(4);
  58.   end;
  59.  
  60.   read(f, screen);
  61.  
  62.   close(f);
  63.   ch := readkey;
  64.   closegraph;
  65.  
  66. end.
  67.